//引入 vue-router插件
import { createRouter, createWebHistory } from 'vue-router'

//import NewVue from '@/newVue.vue'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        // 配置路径和文件的对应关系
        // 静态加载 
        //{path:'/new',component:NewVue}
        //  动态加载    
        {
            path: '/login',
            component: () => import('../views/login.vue')
        },
        {
            path: '/main',
            component: () => import('../views/main.vue'),
            children: [
                {
                    path: '/users',
                    component: () => import('../views/controlCenter/users.vue')
                },
                {
                    path: '/menus',
                    component: () => import('../views/controlCenter/menus.vue')
                },
                //大厅管理
                {
                    path: '/room/categroy',
                    component: () => import('../views/playroom/roomCategroy.vue')
                },
                {
                    path: '/room/info',
                    component: () => import('../views/playroom/roomInfo.vue')
                },
                //游戏管理
                {
                    path: '/games/info',
                    component: () => import('../views/games/gameInfo.vue')
                },
                //客户管理
                {
                    path: '/customer/playcustomer',
                    component: () => import('../views/playcustomer/playcustomer.vue')
                },
                {
                    path: '/customer/godcustomer',
                    component: () => import('../views/playcustomer/godcustomer.vue')
                },
                {
                    path: '/customer/community',
                    component: () => import('../views/playcustomer/community.vue')
                },
                {
                    path: '/customer/dynamics',
                    component: () => import('../views/playcustomer/dynamics.vue')
                },
                //礼物管理
                {
                    path: '/gift/info',
                    component: () => import('../views/gift/giftInfo.vue')
                },
                //订单管理
                {
                    path: '/order/info',
                    component: () => import('../views/order/orderInfo.vue')
                },
                {
                    path: '/order/commentInfo',
                    component: () => import('../views/order/commentInfo.vue')
                },

            ]
        },


        {
            path: '/',
            redirect: '/login'
        }

    ]
})

export default router

